<script type="text/javascript">
var _d = DialogManager.get('config_dialog');
_d.setWidth(440);
_d.setPosition('center');
$(function(){
	$('#add_image').click(function(){
		$(this).before('<div class="field_item">' +
			'<label>上传图片:(<span>支持 gif|jpg|jpeg|png 格式,尺寸:1920px * 500px</span>)</label>' +
			'<p><input type="file" name="ad_image_file[]" /></p>'+
			'<label>底色背景颜色:</label>' +
			'<p style="overflow:hidden;"><input type="text" name="ad_bgcolor[]" value="{$image.ad_bgcolor}" />' +
			'<label>链接地址:</label>' +
			'<p style="overflow:hidden;"><input type="text" name="ad_link_url[]" value="{$image.ad_link_url}" /> ' +
			'<input type="button" value="删除图片" onclick="drop_image(this)" /></p></div>');
	});
});
function drop_image(btnObj)
{
    $(btnObj).parents('.field_item').remove();
}
</script>
<div style="overflow-y:scroll; height:500px;">
<div class="field_item">
  <p style="margin-top:5px;">
图片播放效果:
<select name="effect">
   <option value="leftLoop" {if $options.effect=='leftLoop'} selected="selected"{/if}>左右滚动</option>
   <option value="topLoop" {if $options.effect=='topLoop'} selected="selected"{/if}>上下滚动</option>
   <option value="fade" {if $options.effect=='fade'} selected="selected"{/if}>渐显</option>
   <option value="fold" {if $options.effect=='fold'} selected="selected"{/if}>淡入淡出</option>
</select>
</p>
<p style="margin-top:5px;">
   是否自动播放:
   <select name="autoplay">
      <option value="true" {if $options.autoplay=='true'} selected="selected"{/if}>是</option>
      <option value="false" {if $options.autoplay=='false'} selected="selected"{/if}>否</option>
   </select>
</p>
</div>
<!-- {if $options.ads} -->
<!-- {foreach from=$options.ads item=image} -->
<div class="field_item">
    <label>上传图片:(<span>支持 gif|jpg|jpeg|png 格式,尺寸:1920px * 500px</span>)</label>
    <p><input type="file" name="ad_image_file[]" />
        <input type="hidden" name="ad_image_url[]" value="{$image.ad_image_url}" />
    <img src="{$image.ad_image_url|url_format}" height="15" /></p>
    <label>底色背景颜色:</label>
    <p style="overflow:hidden;"><input type="text" name="ad_bgcolor[]" value="{$image.ad_bgcolor}" />
    <label>链接地址:</label>
    <p style="overflow:hidden;"><input type="text" name="ad_link_url[]" value="{$image.ad_link_url}" />
    <input  type="button" value="删除图片" onclick="drop_image(this)" /></p>
</div>
<!-- {/foreach} -->
<!-- {else} -->
<div class="field_item">
    <label>上传图片:(<span>支持 gif|jpg|jpeg|png 格式,尺寸:1920px * 500px</span>)</label>
    <p><input type="file" name="ad_image_file[]" /></p>
    <label>底色背景颜色:</label>
    <p style="overflow:hidden;"><input type="text" name="ad_bgcolor[]" value="{$image.ad_bgcolor}" />
    <label>链接地址:</label>
    <p style="overflow:hidden;"><input type="text" name="ad_link_url[]" value="{$image.ad_link_url}" />
    <input type="button" value="删除图片" onclick="drop_image(this)" /></p>
</div>
<!-- {/if} -->
<p id="add_image" class="ml5 mt20 fff padding5 center pointer fs14">新增图片</p>
</div>

